Skip to content

config, callback, drawing, main: add LINE and RECT tools, and arrowtype… - #192

Closed
pascal-niklaus wants to merge 1 commit into
bk138:masterfrom
pascal-niklaus:devel_new_rect_and_line_tools
Closed

pascal-niklaus wants to merge 1 commit into
bk138:masterfrom
pascal-niklaus:devel_new_rect_and_line_tools

Conversation

@pascal-niklaus

Copy link
Copy Markdown
Contributor

This adds a LINE and RECT option to draw straight lines and rectangles. Also, arrows can have heads at either or both ends, owing to the new arrowtype option which can be "<-" "->" or "<->".
Here is an example with the corresponding config file.

"red Pen" = PEN (size=5 color="red", arrowsize=2, arrowtype="<->");
"blue Pen" = RECT (color="cyan", size=2);
"yellow Pen" = LINE (color="yellow" size=2 arrowsize=2 arrowtype="->");
"green Marker" = PEN (size=6 color="green" arrowsize=1);

LINE_RECT_arrowtype_example

@bk138

bk138 commented Feb 26, 2024 •

Copy link
Copy Markdown
Owner

This looks exciting as it's an often requested feature (#67)! Can you split the PR into one for each tool and one for the arrow type? That'd be awesome!

@pascal-niklaus

Copy link
Copy Markdown
Contributor Author

This looks exciting as it's an often requested feature (#67)! Can you split the PR into one for each tool and one for the arrow type? That'd be awesome!

That is possible, but LINE and RECT are very related, since both use the same buffer of the original state (basically, at on_button_press a copy of back_buffer is made, and during on_motion the rectangle or line are drawn onto this copy, allowing to dynamically "drag" the rectangle or line.

I could separate out the arrow head code, if this helps, but it really is quite straightforward, and this modification is not independent of LINE (since LINE can have two arrow heads as well).

So if a split is indeed required, I would keep LINE and RECT together, and then produce a 2nd PR with the arrow style that can be applied on top of the first PR.

@bk138

bk138 commented Feb 26, 2024

Copy link
Copy Markdown
Owner

Yeah that sounds good!

@bk138

bk138 commented Mar 2, 2024

Copy link
Copy Markdown
Owner

Closing in favour of #193.

@bk138 bk138 closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants